package com.asset.util;

import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

/**
 * 资产状态字典
 * @author 11725
 */
public abstract class BaseAssetStatus {
    /** 闲置 */
    public static final int AVAILABLE = 0;
    /** 已预定 */
    public static final int HAS_BEEN_BOOKED = 1;
    /** 待处置 */
    public static final int WAIT_FOR_PROCESSING = 2;
    /** 维护 */
    public static final int UNDER_MAINTENANCE = 3;
    /** 维修 */
    public static final int UNDER_REPAIR = 4;
    /** 已报废 */
    public static final int BE_SCRAPPED = 5;
    /** 已转移 */
    public static final int BE_TRANSFERRED = 6;
    /** 已变卖 */
    public static final int SOLD_OFF = 7;

    /**
     * 判断是否为可用状态值
     * @param status        状态值
     * @return              判断结果
     */
    public static boolean isExist(int status) {
        switch (status) {
            case AVAILABLE:
            case HAS_BEEN_BOOKED:
            case WAIT_FOR_PROCESSING:
            case UNDER_MAINTENANCE:
            case UNDER_REPAIR:
            case BE_SCRAPPED:
            case BE_TRANSFERRED:
            case SOLD_OFF:
                return true;
            default:
                return false;
        }
    }
}
